utoipa-actix-web - Bindings for Actix Web and utoipa
This crate implements necessary bindings for automatically collecting paths
and schemas
recursively from Actix Web
App
, Scope
and ServiceConfig
. It provides natural API reducing duplication and support for scopes while generating
OpenAPI specification without the need to declare paths
and schemas
to #[openapi(...)]
attribute of OpenApi
derive.
Currently only service(...)
calls supports automatic collection of schemas and paths. Manual routes via route(...)
or
Route::new().to(...)
is not supported.
Install
Add dependency declaration to Cargo.toml
.
[]
= "0.1"
Examples
Collect handlers annotated with #[utoipa::path]
recursively from service(...)
calls to compose OpenAPI spec.
use ;
use ;
async
let = new
.into_utoipa_app
.service
.split_for_parts;
License
Licensed under either of Apache 2.0 or MIT license at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in this crate by you, shall be dual licensed, without any additional terms or conditions.